import yfinance as yf

# ticker = "BIDU"  # 只下载一个股票
# data = yf.download(ticker, start="2023-01-01", end="2025-10-09")
# data.to_csv(f"/Users/adam/Documents/Developer/MyGithub/RisingR/Data/{ticker}.csv")

import yfinance as yf
import pandas as pd

ticker = "BIDU"

# 分段日期
date_ranges = [("2023-01-01", "2023-06-30"), ("2023-07-01", "2023-12-31"), ("2024-01-01", "2025-10-09")]
all_data = []

for start, end in date_ranges:
    data = yf.download(ticker, start=start, end=end, auto_adjust=True, proxy="http://127.0.0.1:7897")
    all_data.append(data)

data = pd.concat(all_data)
data.to_csv(f"/Users/adam/Documents/Developer/MyGithub/RisingR/Data/{ticker}.csv")